home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
018a
/
apcrssrf.zip
/
CROSSREF.SMM
< prev
next >
Wrap
INI File
|
1991-11-07
|
5KB
|
307 lines
[ver]
4
[sty]
~macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
PostScript Printer
[lang]
1
[desc]
Generate cross references between files in a master document that has less than 8 files.
Lotus Word Processing Division
Advanced
FileOpen, MasterDocument
689536675
17
672617318
46
1
0
0
0
0
0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[l1]
0
[pg]
1
64 0 0 1025 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
[edoc]
<:#202,10080>' Xref - cross reference between files in a master document.
<:#202,10080>' Because the field "Pageref" can only work with bookmarks in
<:#202,10080>' the current file, when the user needs the page number of
<:#202,10080>' a bookmark in another file, he can just insert the bookmark
<:#202,10080>' name where he wants the number.
<:#202,10080>' This macro will run through all files in the master, and for
<:#202,10080>' each bookmark it will determine the actual page number, then
<:#202,10080>' create a global variable by that same name, and assign the
<:#202,10080>' page number to it. Finally it will go through each file agian
<:#202,10080>' updating all fields to satisfy those fields. The field manager
<:#202,10080>' will now find a global varibale to satisfy those bookmark
<:#202,10080>' references.
<:#202,10080>' This version is limited to 9 files, as we keep them all loaded
<:#202,10080>' between the two passes
<:#202,10080>'
<:#202,10080>FUNCTION Xref()
<:#202,10080>defstr mascount;
<:#202,10080>if (0 = Assign(&mascount, GetMasterFilesCount()))
<:#202,10080> message("Not a master document")
<:#202,10080> return -1;
<:#202,10080>endif
<:#202,10080>dim masfiles(mascount)
<:#202,10080>GetMasterFiles(&masfiles)
<:#202,10080>Declare CreateGlobals();
<:#202,10080>Generate(0)
<:#202,10080>for i = 1 to mascount - 1 ' Generate left the last one up
FileOpen(masfiles(i), 1, "AmiPro")
<:#202,10080> DarkMode(1)
<:#202,10080> type("<[>ctrlend]") ' Force load to finish
<:#202,10080> type("<[>ctrlhome]") ' Back to the top for looks
<:#202,10080> DarkMode(0)
<:#202,10080> CreateGlobals()
<:#202,10080>next
<:#202,10080>totalpage = PhysicalToLogical(EvalField("NumPages"));
<:#202,10080>tp = "totalpages"
<:#202,10080>AllocGlobalVar(tp, 1)
<:#202,10080>SetGlobalVar(tp, totalpage)
<:#202,10080>for i = 1 to mascount
<:#202,10080> SelectWindow(masfiles(i))
<:#202,10080> FieldUpdateAll()
<:#202,10080> type("<[>ctrlend]")
<:#202,10080> type("<[>ctrlhome]")
<:#202,10080> Save()
<:#202,10080>next
<:#202,10080>END FUNCTION
<:#202,10080>FUNCTION CreateGlobals()
<:#202,10080>defstr bookcnt
<:#202,10080>if (0 = Assign(&bookcnt, GetBookMarkCount()))
<:#202,10080> return 0; ' No bookmarks, fast exit here
<:#202,10080>endif
<:#202,10080>dim booknames(bookcnt)
<:#202,10080>GetBookMarkNames(&booknames)
<:#202,10080>for i = 1 to bookcnt
<:#202,10080> ' get the GetBookMarkPage returns the page number of the
<:#202,10080> ' bookmark relative to this file, use PhysicalToLogical
<:#202,10080> ' to the the logical page. Then create a global var
<:#202,10080> ' using the bookmark name, then assign that page number.
<:#202,10080>
<:#202,10080> page = PhysicalToLogical(GetBookMarkPage(booknames(i)))
<:#202,10080> AllocGlobalVar(booknames(i), 1)
<:#202,10080> SetGlobalVar(booknames(i), page)
<:#202,10080>next
<:#202,10080>END FUNCTION
<:#202,10080>
>
[Embedded]
00003658
>
[macsum] 2
Xref 0 0 6 15
CreateGlobals 629 0 5 45
[macse]
14 Xref
5 0
0 1047
13
0 805 &1 [X]
13
18 0
11 00000105
0 3 "Not a master document"
5 -1
15
9
6 1
21 2 [X]
0 1048 &2
2 465 1 0
5 1
8 3
6 1
5 1
3 1
6 3
18 2
12 00000237
10 00000351
5 1
6 3
3 0
8 3
10 00000152
6 3
22 2
2 102 1 [X] 1 "AmiPro"
0 292 1
0 6 "[16419]"
0 6 "[16420]"
0 292 0
16 CreateGlobals
10 00000204
0 1289 "NumPages"
13
0 791 [X]
13
8 4
7 "totalpages"
8 5
0 271 "{5}" 1
0 264 "{5}" "{4}"
5 1
8 3
6 1
6 3
18 2
12 00000534
10 00000617
5 1
6 3
3 0
8 3
10 00000459
6 3
22 2
0 796 [X]
2 267 1
0 6 "[16419]"
0 6 "[16420]"
2 103 1
10 00000501
6 0
15
9
14 CreateGlobals
5 0
0 1039
13
0 805 &1 [X]
13
18 0
11 00000084
5 0
15
9
6 1
21 2 [X]
0 1040 &2
5 1
8 3
6 1
6 3
18 2
12 00000195
10 00000307
5 1
6 3
3 0
8 3
10 00000120
6 3
22 2
0 1049 [X]
13
0 791 [X]
13
8 4
6 3
22 2
0 271 [X] 1
6 3
22 2
0 264 [X] "{4}"
10 00000162
6 0
15
9
00003683